package com.xiyucode.yuerinterface.controller;


import cn.hutool.core.date.DateUtil;
import com.xiyucode.yuerclientsdk.model.User;
import org.springframework.web.bind.annotation.*;

/**
 * 小工具类 Controller
 *
 * @author xiyucode
 */
@RestController
@RequestMapping("/say")
public class SayController {

    @GetMapping("/getDate")
    public String getDateByGet(){
        return "当前北京时间为 :" + DateUtil.now();
    }

    @GetMapping("/userGetDate")
    public String userGetDateByGet(@RequestParam String user){
        return "你好" + user + ",当前北京时间为 : " + DateUtil.now();
    }

    @PostMapping("/userGetDate")
    public String userGetDateByPost(@RequestBody User user){
        return "你好" + user.getUsername() + ",当前北京时间为 : " + DateUtil.now();
    }

}
